﻿@{
    if (HttpContext.Current.User.Identity.IsAuthenticated)
    {
        {
            <script>
                $(document).ready(function() {
                    var userId = @HttpContext.Current.User.Identity.Name;
                    $.ajax({
                        url: "@Url.Content("~/Account/GetName")?userId=" + userId,
                        type: 'GET',
                        success: function(name) {
                            $("#fullname").html(name);
                        }
                    });
                });
            </script>
            <span>Hello,&nbsp;</span>
            <span>@Html.ActionLink("Name", "Index", "Account", new { Area = "" }, new { id = "fullname" })</span>
            <span>|</span>
            <span>@Html.ActionLink("Account", "Index", "Account", new { Area = "" }, new { })</span>
            <span>|</span>
            <span>@Html.ActionLink("Logout", "LogOut", "Account", new { Area = "" }, new { })</span>
        }
    }
    else
    {
        <span>
            @Html.ActionLink("Login", "LogIn", "Account", new {Area = ""}, new {})
        </span>
    }
}
